import React, {Component} from 'react';
import {WebView} from 'react-native';

import LoadingView from './LoadingView.js';

/**
 * 商品详情页面
 * Created by 10691 on 17/5/15.
 */
export default class GoodsDetails extends Component {

    render() {
        const {params} = this.props.navigation.state;
        return (
            <WebView
                style={{flex: 1}}
                source={{uri: 'https://guangdiu.com/api/showdetail.php' + '?' + 'id=' + params.ID, method: 'GET'}}
                javaScriptEnabled={true}
                domStorageEnabled={true}
                scalesPageToFit={false}
                startInLoadingState={true} // 必须设置此属性才会调用下面的方法
                // 显示加载视图
                renderLoading={() => {
                    return <LoadingView/>
                }}/>
        )
    }
}